/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include <三角形.h>

#include "core/shader_std.h"
#include "引擎数据类型.h"

//void f_engine_计算三角形点包围盒(std::vector<S_Sphere>& 包围盒, const std::vector<vec3>& verts, const std::vector<uvec3>& indexs);




template<typename T>
auto constexpr f_df_创建常量推送 = [](S_推送常量& push, E_着色阶段 着色阶段){
	push.m_常量推送字节大小 = sizeof(T);
	push.m_常量推送绑定阶段 = 着色阶段;
	push.m_常量推送 = calloc(1, push.m_常量推送字节大小);
};

auto constexpr f_df_销毁常量推送 = [](S_推送常量& push){
	push.m_常量推送字节大小 = 0;
	push.m_常量推送绑定阶段 = 0;
	free(push.m_常量推送);
};

template<typename T>
auto f_df_推送常量 = [](S_推送常量& push) -> T& {
	return *((T*)push.m_常量推送);
};














